import 'package:flutter/material.dart';

class CLHomeModel {
  /// 房间id
  String roomId;
  /// 横屏封面
  String roomSrc;
  /// 竖屏封面
  String verticalSrc;
  /// 是否竖屏
  int isVertical;
  int cateId;
  /// 房间名
  String roomName;
  /// 是否在直播
  String showStatus;
  /// 主播名
  String nickname;
  /// 在线人数
  int online;
  /// 直播类型
  String gameName;
  /// 头像
  String avatarMid;
  /// 城市
  String anchorCity;
  /// 直播时间
  String showTime;
  /// 主播id
  String ownerUid;

  
  CLHomeModel(
      {this.roomId,
      this.roomSrc,
      this.verticalSrc,
      this.isVertical,
      this.cateId,
      this.roomName,
      this.showStatus,
      this.showTime,
      this.ownerUid,
      this.nickname,
      this.online,
      this.gameName,
      this.avatarMid,
      this.anchorCity});

  CLHomeModel.fromJson(Map<String, dynamic> json) {
    roomId = json['room_id'];
    roomSrc = json['room_src'];
    verticalSrc = json['vertical_src'];
    isVertical = json['isVertical'];
    cateId = json['cate_id'];
    roomName = json['room_name'];
    showStatus = json['show_status'];
    showTime = json['show_time'];
    ownerUid = json['owner_uid'];
    nickname = json['nickname'];
    online = json['online'];
    gameName = json['game_name'];
    avatarMid = json['avatar_mid'];
    anchorCity = json['anchor_city'];
  }
  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['room_id'] = this.roomId;
    data['room_src'] = this.roomSrc;
    data['vertical_src'] = this.verticalSrc;
    data['isVertical'] = this.isVertical;
    data['cate_id'] = this.cateId;
    data['room_name'] = this.roomName;
    data['show_status'] = this.showStatus;
    data['show_time'] = this.showTime;
    data['owner_uid'] = this.ownerUid;
    data['nickname'] = this.nickname;
    data['online'] = this.online;
    data['game_name'] = this.gameName;
    data['avatar_mid'] = this.avatarMid;
    data['anchor_city'] = this.anchorCity;
    return data;
  }

}

class Autogenerated {
  int error;
  List<CLHomeModel> data;

  Autogenerated({this.error, this.data});

  Autogenerated.fromJson(Map<String, dynamic> json) {
    error = json['error'];
    if (json['data'] != null) {
      data = new List<CLHomeModel>();
      json['data'].forEach((v) {
        data.add(new CLHomeModel.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['error'] = this.error;
    if (this.data != null) {
      data['data'] = this.data.map((v) => v.toJson()).toList();
    }
    return data;
  }
}